﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Zhao.Models.Entity
{
    /// <summary>
    /// 系统管理员表
    ///</summary>
    [SugarTable("Admin")]
    public class Admin
    {

        /// <summary>
        /// 备  注:主键ID（自增，唯一标识）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 备  注:用户名（唯一，用于登录）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "userName")]
        public string UserName { get; set; } = null!;

        /// <summary>
        /// 备  注:加密后的密码（使用BCrypt/Argon2等安全哈希算法）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Password")]
        public string Password { get; set; } = null!;

        /// <summary>
        /// 备  注:绑定邮箱（唯一，用于找回密码）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Email")]
        public string Email { get; set; } = null!;

        /// <summary>
        /// 备  注:账号状态：0=禁用，1=启用，2=锁定
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Status")]
        public bool Status { get; set; }

        /// <summary>
        /// 备  注:角色（如：superadmin, admin, editor）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Role")]
        public int Role { get; set; }

        /// <summary>
        /// 备  注:创建时间（自动记录插入时间）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "CateTime")]
        public DateTime CateTime { get; set; }

        /// <summary>
        /// 备  注:最后更新时间（自动记录修改时间）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Updated")]
        public DateTime? Updated { get; set; }

        /// <summary>
        /// 备  注:最后一次登录时间
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "LastLoginAt")]
        public DateTime? LastLoginAt { get; set; }

        /// <summary>
        /// 备  注:最后一次登录IP（支持IPv6）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "LastLoginIp")]
        public string? LastLoginIp { get; set; }
        /// <summary>
        /// 备  注:手机号码
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Phone")]
        public string Phone { get; set; }
        /// <summary>
        /// 备  注:真实姓名
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "FullName")]
        public string FName { get; set; }
        /// <summary>
        /// 球馆Id
        /// 如果是馆主或球馆管理员
        /// </summary>
        [SugarColumn(ColumnName = "VenueId")]
        public Guid? VenueId { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(ColumnName = "IsDelete")]
        public bool  IsDelete { get; set; }
        /// <summary>
        ///管理员头像
        /// </summary>
        [SugarColumn(ColumnName = "IamgeUrl")]
        public string IamgeUrl { get; set; }
    }

}